<template>
	<!-- 寻配件 添加分类 -->
	<view class="u-wrap">
		<!-- 搜索 -->
		<view class="searchfor">
			<u-search @search="search" :show-action="false" placeholder="输入配件名称搜索" height="66" bg-color="#fff" v-model="keyWords"
			 :clearabled="true"></u-search>
		</view>
		<!-- 车型 -->
    <car-info :classFlag="shifouhuad" :carInfo="carInfo" type="qiehuan"></car-info>

<!--    已添加-->
		<view :class="shifouhuad ?'headrtitle': 'headrtitleces'">
			<view class="added1">
				<view class="addname">
					已添加 {{Selectresult.length}}/50
				</view>
				<view class="addqingk" @click="qingkoing">
					清空
				</view>
			</view>
			<view class="added2" v-show="!displaybrand">
				<view class="Selectedc">
					<view class="selename" v-for="(item,index) in Selectresultxisnhi" :key="index">
						<text>{{ item.part_Category_Name }}</text>
            <view class="selename-icon" @click="deleteclick(index)">
              <i-icon icon="iconshanchu1" type="single" size="30rpx" color="#EB5C02" ></i-icon>
            </view>

					</view>
				</view>
			</view>
			<view class="added2" v-show="displaybrand">
				<view class="Selectedc">
					<view class="selename" v-for="(item,index) in Selectresult" :key="index">
						<text>{{item.part_Category_Name}}</text>
            <view class="selename-icon" @click="deleteclick(index)">
              <i-icon icon="iconshanchu1" type="single" size="30rpx" color="#EB5C02"></i-icon>
            </view>

					</view>
				</view>
			</view>
			<view class="added3" v-show="Selectresult.length">
				<view class="lookxq" @click="lookmorclick">
					<view class="gengd">
						<view>
							{{lookmore}}
						</view>
						<view :class="displaybrand ? 'lookxqimggo' : 'lookxqimg'">
              <u-icon :name="displaybrand ?'arrow-up' : 'arrow-down'" color="#9A9A9A" size="22rpx"></u-icon>
						</view>
					</view>
				</view>
			</view>
		</view>

<!--    列表-->
		<view class="u-menu-wrap">
			<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
			 :scroll-into-view="itemId">
				<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" :class="[current == index ? 'u-tab-item-active' : '']"
				 @tap.stop="swichMenu(item,index)">
					<text class="u-line-1">{{item.name}}</text>
				</view>
			</scroll-view>
			<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
				<view class="page-view">
					<view class="class-item" :id="'item' + index" v-for="(item , index) in tabbar" :key="index">
						<view class="item-title">
							<view class="xiant"></view>
							<view class="xtname">{{item.name}}</view>
							<view class="xiant"></view>
						</view>
						<view class="item-container">
							<view class="thumb-box" v-for="(item1, index1) in item.children" :key="index1" @click="bussclick(item1)">
								<view class="thuimgs">
									<image v-if="item1.image" class="item-menu-image" :src="item1.image" mode=""></image>
                  <i-icon v-else icon="iconzanwutupian_1" type="single" size="146rpx" color="#e1e1e1"></i-icon>
								</view>
								<view class="xuanzbox" v-for="(item2, index2) in fnamelist" :key="index2">
									<view class="xuanzhong" v-show="item2 && item1.id == item2.part_Category_Id">
                    <i-icon class="icon" icon="icongouxuan1" type="single" size="50rpx" color="#EB5C02"></i-icon>
									</view>
								</view>
								<view class="item-menu-name">{{item1.name}}</view>
							</view>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>
		<view class="quedingbtn" >
			<button class="btn" @click="confirm">确认</button>
		</view>
	</view>
</template>
<script src="./selectCategory.js"></script>
<style lang="scss" scoped>
	@import './selectCategory.scss';
</style>
